<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">
<meta name="viewport" content="width=device-width,user-scalable=no" />
<head>
<meta charset="UTF-8">
<title>文件列表</title>
<link rel="stylesheet"
	href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script
	src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
</head>

<style>
.login-container {
	margin: 10px;
	width: 100%;
}

.form-container {
	margin: 0px auto;
	width: 90%;
	text-align: center;
	box-shadow: 1px 1px 10px #888888;
	height: 100%;
	padding: 5px;
}

.title {
	margin-top: 5px;
	font-size: 18px;
	color: #E9686B;
}
</style>
<body>
	<div class="login-container">
		<div class="form-container">
			<p class="title" th:text="${dirPath}"></p>
			<p><a th:href="@{/logout}" >退出</a></p>
			<table align="center" class="table table-bordered"
				style="width: 95%;">
				<thead>
					<tr class="active">
						<th>名称</th>
						<th>路径</th>
						<th>文件大小</th>
						<th>创建时间</th>
						<th>修改时间</th>
						<th>下载</th>
					</tr>
						<div th:switch="${file.isVertul}" th:each="file: ${allFile}">
							<div th:case="false">
							    <tr th:switch="${file.isDir}">
									<td th:text="${file.name}"></td>
									<td><a th:case="false"
										th:href="@{/view(path=${file.path})}" target="_blank"
										th:text="${file.name}"></a> <a th:case="true"
										th:href="@{/list(dirPath=${file.path},isVertul=${file.isVertul})}"
										th:text="${file.name}"></a></td>
									<td th:text="${file.size}"></td>
									<td th:text="${file.createDate}"></td>
									<td th:text="${file.alertTime}"></td>
									<td><a 
										th:href="@{/downLoad(path=${file.path})}" target="_blank"
										>下载</a> </td>
								</tr>
							</div>
							<div th:case="true">
								<tr>
								  <td colspan="6"><a
										th:href="@{/list(dirPath=${file.path},isVertul=${file.isVertul})}"
										th:text="${file.name}"></a></td>
								</tr>
							</div>
						</div>

					
				</thead>
			</table>
		</div>
	</div>
</body>
</html>